import requests
from bs4 import BeautifulSoup

import urllib3

urllib3.disable_warnings()

headers = {'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0'}

def getContext(url):
    source_code = requests.get(url, headers=headers, verify=False)
    source_code.encoding = 'utf-8'
    plain_text = source_code.text
    soup = BeautifulSoup(plain_text,  'lxml')
    return soup

def getContextByEncode(url, encoding):
    source_code = requests.get(url, headers=headers, verify=False)
    source_code.encoding = encoding
    plain_text = source_code.text
    soup = BeautifulSoup(plain_text,  'lxml')
    return soup
